package com.example.com.myapplication.activity;

import android.app.Activity;
import android.os.Bundle;
import android.widget.GridView;

import com.example.com.myapplication.IntentDataHelper;
import com.example.com.myapplication.R;
import com.example.com.myapplication.adapter.FaceGridAdapter;

/**
 * @author by licheng on 2017/7/6.
 */
public class ResultActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_result);
        if (!checkData()) {
            finish();
        }
        init();
    }

    private boolean checkData() {
        return null != IntentDataHelper.getFaceList();
    }

    private void init() {
        GridView faceGridView = (GridView) findViewById(R.id.face_container);
        faceGridView.setAdapter(new FaceGridAdapter(this, IntentDataHelper.getFaceList()));

        GridView bigFaceGridView = (GridView) findViewById(R.id.big_face_container);
        bigFaceGridView.setAdapter(new FaceGridAdapter(this, IntentDataHelper.getBigFaceList()));

    }
}
